//平台属性
import request from '@/utils/request'

//获取一级分类
export const reqCategory1List = ()=>{
 return request({
   url:'/admin/product/getCategory1',
   method:'GET'
 })
}
//获取二级分类
export const reqCategory2List = (id)=>{
 return request({
   url:'/admin/product/getCategory2/'+id,
   method:'GET'
 })
}
//获取三级分类
export const reqCategory3List = (id)=>{
 return request({
   url:'/admin/product/getCategory3/'+id,
   method:'GET'
 })
}
//根据分类获取平台属性
export const reqGetAttr = (category1Id,category2Id,category3Id)=>{
 return request({
   url:`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`,
   method:'GET'
 })
}
//添加属性与属性值
export const reqAddOrUpdateAttr = (data)=>{
  return request({
    url:`/admin/product/saveAttrInfo`,
    data,
    method:'POST',
  })
}
//删除属性
export const reqDeleteAttr = (attrId)=>{
 return request({
   url:`/admin/product/deleteAttr/${attrId}`,
   method:"DELETE",
 })
}
